/* SCROLL */
var ScrollToAnchor = new Class({
	initialize: function(anchor){
		this.anchor = $(anchor);
		this.link = this.anchor.getProperty("href");
		this.hrefToID = this.link.substring(1);
		
		this.anchor.addEvent("click", function(e){
			e.stop();
			this.scrollTo(this.hrefToID);
		}.bind(this));
	},
	
	scrollTo: function(toElement){
		var myScroll = new Fx.Scroll(document.body).toElement(toElement);
		document.location.hash = toElement;
	}
});

new Moodule(
	"a.scrollAnchor", 
	
	ScrollToAnchor,
	
	{
		classId: "ScrollToAnchor",
		checkCapabilities: ["css"]
	}
);
